Skip to content

Move build summary extraction logic out #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Jul 19, 2024
Merged

Move build summary extraction logic out #487

merged 37 commits into from
Jul 19, 2024

Conversation

sorin-florea
Copy link
Member

@sorin-florea sorin-florea commented Aug 22, 2023

This PR moves the build scan summary logic into a separate jar file that is built externally to the build validation scripts.

It also restructures the final distribution.

New Gradle scripts distribution layout:

gradle-enterprise-gradle-build-validation
├── 01-validate-incremental-building.sh
├── 02-validate-local-build-caching-same-location.sh
├── 03-validate-local-build-caching-different-locations.sh
├── 04-validate-remote-build-caching-ci-ci.sh
├── 05-validate-remote-build-caching-ci-local.sh
├── LICENSE
├── NOTICE
├── README.md
├── VERSION
├── gradle-enterprise.license
├── lib
│   ├── develocity
│   │   └── build-scan-summary-0.9-2024.1.2-prerelease.jar
│   ├── scripts
│   │   ├── 01-cli-parser.sh
│   │   ├── 02-cli-parser.sh
│   │   ├── 03-cli-parser.sh
│   │   ├── 04-cli-parser.sh
│   │   ├── 05-cli-parser.sh
│   │   ├── build-scan-offline.sh
│   │   ├── build-scan-online.sh
│   │   ├── build-scan-parse.sh
│   │   ├── color.sh
│   │   ├── config.sh
│   │   ├── exit-code.sh
│   │   ├── git.sh
│   │   ├── gradle-init-scripts
│   │   │   ├── configure-gradle-enterprise.gradle
│   │   │   ├── configure-local-build-caching.gradle
│   │   │   └── configure-remote-build-caching.gradle
│   │   ├── gradle.sh
│   │   ├── help.sh
│   │   ├── init.sh
│   │   ├── interactive-mode.sh
│   │   ├── java.sh
│   │   ├── libs.sh
│   │   ├── logging.sh
│   │   ├── maven.sh
│   │   ├── paths.sh
│   │   ├── project.sh
│   │   └── summary.sh
│   └── third-party
│       ├── annotations-13.0.jar
│       ├── checker-qual-3.41.0.jar
│       ├── error_prone_annotations-2.23.0.jar
│       ├── failureaccess-1.0.2.jar
│       ├── gson-2.10.1.jar
│       ├── gson-fire-1.8.5.jar
│       ├── guava-33.0.0-jre.jar
│       ├── javax.annotation-api-1.3.2.jar
│       ├── javax.ws.rs-api-2.1.1.jar
│       ├── jsr305-3.0.2.jar
│       ├── jsr311-api-1.1.1.jar
│       ├── kotlin-stdlib-1.6.20.jar
│       ├── kotlin-stdlib-common-1.6.20.jar
│       ├── kotlin-stdlib-jdk7-1.6.20.jar
│       ├── kotlin-stdlib-jdk8-1.6.20.jar
│       ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
│       ├── logging-interceptor-4.10.0.jar
│       ├── okhttp-4.11.0.jar
│       ├── okhttp-tls-4.11.0.jar
│       ├── okio-jvm-3.2.0.jar
│       ├── picocli-4.7.5.jar
│       └── swagger-annotations-1.6.10.jar
├── mapping.example
└── network.settings

New Maven scripts distribution layout:

gradle-enterprise-maven-build-validation
├── 01-validate-local-build-caching-same-location.sh
├── 02-validate-local-build-caching-different-locations.sh
├── 03-validate-remote-build-caching-ci-ci.sh
├── 04-validate-remote-build-caching-ci-local.sh
├── LICENSE
├── NOTICE
├── README.md
├── VERSION
├── lib
│   ├── develocity
│   │   ├── build-scan-summary-1.0-2024.1-20240529162525.jar
│   │   └── gradle-enterprise-maven-extension-1.18.4.jar
│   ├── scripts
│   │   ├── 01-cli-parser.sh
│   │   ├── 02-cli-parser.sh
│   │   ├── 03-cli-parser.sh
│   │   ├── 04-cli-parser.sh
│   │   ├── build-scan-offline.sh
│   │   ├── build-scan-online.sh
│   │   ├── build-scan-parse.sh
│   │   ├── color.sh
│   │   ├── config.sh
│   │   ├── exit-code.sh
│   │   ├── git.sh
│   │   ├── gradle.sh
│   │   ├── help.sh
│   │   ├── init.sh
│   │   ├── interactive-mode.sh
│   │   ├── java.sh
│   │   ├── libs.sh
│   │   ├── logging.sh
│   │   ├── maven-libs
│   │   │   └── configure-gradle-enterprise-maven-extension-2.5.2-all.jar
│   │   ├── maven.sh
│   │   ├── paths.sh
│   │   ├── project.sh
│   │   └── summary.sh
│   └── third-party
│       ├── annotations-13.0.jar
│       ├── checker-qual-3.41.0.jar
│       ├── common-custom-user-data-maven-extension-1.13.jar
│       ├── error_prone_annotations-2.23.0.jar
│       ├── failureaccess-1.0.2.jar
│       ├── gson-2.10.1.jar
│       ├── gson-fire-1.9.0.jar
│       ├── guava-33.0.0-jre.jar
│       ├── javax.annotation-api-1.3.2.jar
│       ├── javax.ws.rs-api-2.1.1.jar
│       ├── jsr305-3.0.2.jar
│       ├── jsr311-api-1.1.1.jar
│       ├── kotlin-stdlib-1.6.20.jar
│       ├── kotlin-stdlib-common-1.6.20.jar
│       ├── kotlin-stdlib-jdk7-1.6.20.jar
│       ├── kotlin-stdlib-jdk8-1.6.20.jar
│       ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
│       ├── logging-interceptor-4.10.0.jar
│       ├── okhttp-4.11.0.jar
│       ├── okhttp-tls-4.11.0.jar
│       ├── okio-jvm-3.2.0.jar
│       ├── picocli-4.7.5.jar
│       └── swagger-annotations-1.6.10.jar
├── mapping.example
└── network.settings

Copy link
Member

@etiennestuder etiennestuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left some comments for polishing.

Copy link
Member

@etiennestuder etiennestuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, Sorin.

@jthurne jthurne force-pushed the sorin/consolidation branch from aa746ec to 77b69fc Compare May 3, 2024 07:32
@jthurne jthurne requested a review from erichaagdev May 3, 2024 07:33
@jthurne jthurne force-pushed the sorin/consolidation branch from 77b69fc to 48d7169 Compare May 3, 2024 08:38
@erichaagdev
Copy link
Member

Successfully ran the below experiments at commit 0e2028a.

./01-validate-incremental-building.sh -r git@github.com:gradle/gradle-build-scan-quickstart.git -c 710a21dad423192a0ea2d9aea77f381f40eb8a6a -t 'build' -s https://ge.solutions-team.gradle.com
./02-validate-local-build-caching-same-location.sh -r git@github.com:gradle/gradle-build-scan-quickstart.git -c 710a21dad423192a0ea2d9aea77f381f40eb8a6a -t 'build' -s https://ge.solutions-team.gradle.com
./03-validate-local-build-caching-different-locations.sh -r git@github.com:gradle/gradle-build-scan-quickstart.git -c 710a21dad423192a0ea2d9aea77f381f40eb8a6a -t 'build' -s https://ge.solutions-team.gradle.com

./01-validate-local-build-caching-same-location.sh -r git@github.com:gradle/maven-build-scan-quickstart.git -c feb731de5b279d3a941f81fb3d1845ec0405388b -g 'verify' -s https://ge.solutions-team.gradle.com
./02-validate-local-build-caching-different-locations.sh -r git@github.com:gradle/maven-build-scan-quickstart.git -c feb731de5b279d3a941f81fb3d1845ec0405388b -g 'verify' -s https://ge.solutions-team.gradle.com

@jthurne jthurne force-pushed the sorin/consolidation branch from 0e2028a to 8721a55 Compare May 8, 2024 18:47
@erichaagdev
Copy link
Member

When I invoke a script I get this right at the start:

image

Message:

/Users/eric/Projects/gradle/gradle-enterprise-gradle-build-validation/local/lib/scripts/exit-code.sh: line 3: SUCCESS: readonly variable

To reproduce it, just run:

./01-validate-incremental-building.sh \
  -r git@github.com:gradle/gradle-build-scan-quickstart.git \
  -c 710a21dad423192a0ea2d9aea77f381f40eb8a6a \
  -t 'build' \
  -s https://ge.solutions-team.gradle.com

@erichaagdev
Copy link
Member

This is probably an issue with the jar, but I noticed this in debug mode:

image

@jthurne jthurne self-assigned this May 9, 2024
@jthurne
Copy link
Member

jthurne commented May 9, 2024

When I invoke a script I get this right at the start:

image

Message:

/Users/eric/Projects/gradle/gradle-enterprise-gradle-build-validation/local/lib/scripts/exit-code.sh: line 3: SUCCESS: readonly variable

To reproduce it, just run:

./01-validate-incremental-building.sh \
  -r git@github.com:gradle/gradle-build-scan-quickstart.git \
  -c 710a21dad423192a0ea2d9aea77f381f40eb8a6a \
  -t 'build' \
  -s https://ge.solutions-team.gradle.com

Fixed in 9fadce5

Co-authored-by: Eric Haag <ehaag@gradle.com>
Signed-off-by: Sorin Florea <sorin.florea.v@gmail.com>
@erichaagdev
Copy link
Member

Did some testing and all looks good up to this point. Each distribution has their respective license and scripts are working as expected.

jthurne and others added 7 commits June 12, 2024 11:50
Co-authored-by: Eric Haag <ehaag@gradle.com>
Signed-off-by: Jim Hurne <jhurne@gradle.com>
* origin/main:
  Bump com.google.guava:guava from 33.2.0-jre to 33.2.1-jre
  Bump Gradle Wrapper from 8.7 to 8.8
  Bump org.apache.maven:maven-core from 3.9.6 to 3.9.7
  Bump com.gradle.develocity from 3.17.3 to 3.17.4
  Bump com.gradle.develocity from 3.17.2 to 3.17.3
The Develocity Maven Extension is covered by the same terms of use as the
fetch-build-scans utility is, so we want it to be in the same directory.
From the perspective of this project, it's a third-party open source
dependency.
Co-authored-by: Eric Haag <ehaag@gradle.com>
Signed-off-by: Jim Hurne <jhurne@gradle.com>
The Gradle Enterprise Maven Extension was renamed to the Develocity Maven
Extension in version 1.21.  The API was also updated for the product name
change. Unfortunately, this broke compatibility with the Build Validation
Scripts. This commit fixes the incompatibility.

The fix works by updating the configure-gradle-enterprise-maven-extension to
define and register two listeners: a GradleEnterpriseListener and a
DevelocityListener.  If an older version of the Gradle Enterprise Maven
Extension is used, it will load the GradleEnterpriseListener.  If a newer
version of the Develocity Maven Extension is used, then it will load the
DevelocityListener. The Develocity Maven Extension Adapters are used to
eliminate duplication between the two different listeners.

This commit also creates a "fat jar" so that the develocity-maven-extention-adapters jar
does not have to be manually added to the classpath.

The project compiles agianst an older version of Maven to ensure compatibility
with projects using an older version of Maven.

**Remove unused variables and suppress deprecation warnings**

Unused warnings were previously suppressed because the main classes aren't used
directly. However, this suppressed other unused warnings and hid a few things
that are not actually used.  So this commit un-supresses unused warnings and
removes the unused variables and parameters.

The attempt to suppress deprecation warnings on the ConfigureGradleEnterprise
class wasn't working because the deprecated classes are referenced in import
statements. The class was updated to use the fully qualified name of the
deprecated classes.

---------

Signed-off-by: Jim Hurne <jhurne@gradle.com>
Co-authored-by: Eric Haag <ehaag@gradle.com>
Co-authored-by: Brian Demers <brian.demers@gmail.com>
@jthurne jthurne force-pushed the sorin/consolidation branch from 9c8ed3c to b51d887 Compare June 14, 2024 18:27
jthurne added 5 commits June 14, 2024 15:01
* origin/main:
  Add support for the renamed Develocity Maven Extension (#624)
Sync is slightly better because it effectively resets the output directory
before copying. That way, old files that shouldn't be included anymore are not
included (and avoids having to run ./gradlew clean).
* origin/main:
  Bump github/combine-prs from 5.0.0 to 5.1.0
  Bump Gradle Wrapper from 8.8 to 8.9
  Migrated to gradle/actions/setup-gradle@v3 and removed info logging from build-verification
  Migrated github actions gradle executions to accessToken auth and renamed the secret to develocity naming
@jthurne jthurne merged commit 711ead5 into main Jul 19, 2024
5 checks passed
@jthurne jthurne deleted the sorin/consolidation branch July 19, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants